﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSetDatabaseTraceDetails" targetNamespace="http://tempuri.org/DataSetDatabaseTraceDetails.xsd" xmlns:mstns="http://tempuri.org/DataSetDatabaseTraceDetails.xsd" xmlns="http://tempuri.org/DataSetDatabaseTraceDetails.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection ConnectionStringObject="Data Source=(local);Initial Catalog=SQLServerOptimizer;Integrated Security=True;Pooling=False" IsAppSettingsProperty="false" Modifier="Assembly" Name="sereena-pc\sereenasql2008.SQLServerHealthCheckDeploy.dbo" ParameterPrefix="@" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DatabaseTraceDetailsTableAdapter" GeneratorDataComponentClassName="DatabaseTraceDetailsTableAdapter" Name="DatabaseTraceDetails" UserDataComponentName="DatabaseTraceDetailsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="sereena-pc\sereenasql2008.SQLServerHealthCheckDeploy.dbo" DbObjectName="SELECT NormalizedTextData AS NormalizedSQL, COUNT(NormalizedTextData) AS Count, SUM(CPU) AS CPU, SUM(Reads) AS Reads, SUM(Writes) AS Writes, SUM(Duration) AS Duration FROM DatabaseTraceDetails WHERE (LEN(LTRIM(RTRIM(NormalizedTextData))) &lt;&gt; 0) AND (@DatabaseTraceID = - 1) OR (LEN(LTRIM(RTRIM(NormalizedTextData))) &lt;&gt; 0) AND (DatabaseTraceId = @DatabaseTraceID) GROUP BY NormalizedTextData" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>SELECT        TOP (10) NormalizedSQL, Count, CPU, Reads, Writes, Duration, CPU / Count AS AvgCPU, Reads / Count AS AvgReads
FROM            (SELECT        NormalizedTextData AS NormalizedSQL, COUNT(NormalizedTextData) AS Count, SUM(CPU) AS CPU, SUM(Reads) AS Reads, SUM(Writes) AS Writes, 
                                                    SUM(Duration) AS Duration
                          FROM            DatabaseTraceDetails
                          WHERE        (LEN(LTRIM(RTRIM(NormalizedTextData))) &lt;&gt; 0) AND (@DatabaseTraceID = - 1) OR
                                                    (LEN(LTRIM(RTRIM(NormalizedTextData))) &lt;&gt; 0) AND (DatabaseTraceId = @DatabaseTraceID)
                          GROUP BY NormalizedTextData) AS T
ORDER BY Duration DESC</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="DatabaseTraceID" ColumnName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@DatabaseTraceID" Precision="0" Scale="0" Size="4" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Reads" DataSetColumn="Reads" />
              <Mapping SourceColumn="Writes" DataSetColumn="Writes" />
              <Mapping SourceColumn="Duration" DataSetColumn="Duration" />
              <Mapping SourceColumn="NormalizedSQL" DataSetColumn="NormalizedSQL" />
              <Mapping SourceColumn="Count" DataSetColumn="Count" />
              <Mapping SourceColumn="AvgReads" DataSetColumn="AvgReads" />
              <Mapping SourceColumn="CPU" DataSetColumn="CPU1" />
              <Mapping SourceColumn="AvgCPU" DataSetColumn="AvgCPU1" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DataSetDatabaseTraceDetails" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DataSetDatabaseTraceDetails" msprop:Generator_UserDSName="DataSetDatabaseTraceDetails">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="DatabaseTraceDetails" msprop:Generator_TableClassName="DatabaseTraceDetailsDataTable" msprop:Generator_TableVarName="tableDatabaseTraceDetails" msprop:Generator_TablePropName="DatabaseTraceDetails" msprop:Generator_RowDeletingName="DatabaseTraceDetailsRowDeleting" msprop:Generator_UserTableName="DatabaseTraceDetails" msprop:Generator_RowChangingName="DatabaseTraceDetailsRowChanging" msprop:Generator_RowEvHandlerName="DatabaseTraceDetailsRowChangeEventHandler" msprop:Generator_RowDeletedName="DatabaseTraceDetailsRowDeleted" msprop:Generator_RowEvArgName="DatabaseTraceDetailsRowChangeEvent" msprop:Generator_RowChangedName="DatabaseTraceDetailsRowChanged" msprop:Generator_RowClassName="DatabaseTraceDetailsRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Reads" msprop:Generator_ColumnVarNameInTable="columnReads" msprop:Generator_ColumnPropNameInRow="Reads" msprop:Generator_ColumnPropNameInTable="ReadsColumn" msprop:Generator_UserColumnName="Reads" type="xs:long" minOccurs="0" />
              <xs:element name="Writes" msprop:Generator_ColumnVarNameInTable="columnWrites" msprop:Generator_ColumnPropNameInRow="Writes" msprop:Generator_ColumnPropNameInTable="WritesColumn" msprop:Generator_UserColumnName="Writes" type="xs:long" minOccurs="0" />
              <xs:element name="Duration" msprop:Generator_ColumnVarNameInTable="columnDuration" msprop:Generator_ColumnPropNameInRow="Duration" msprop:Generator_ColumnPropNameInTable="DurationColumn" msprop:Generator_UserColumnName="Duration" type="xs:long" minOccurs="0" />
              <xs:element name="NormalizedSQL" msprop:Generator_ColumnVarNameInTable="columnNormalizedSQL" msprop:Generator_ColumnPropNameInRow="NormalizedSQL" msprop:Generator_ColumnPropNameInTable="NormalizedSQLColumn" msprop:Generator_UserColumnName="NormalizedSQL" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Count" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCount" msprop:Generator_ColumnPropNameInRow="Count" msprop:Generator_ColumnPropNameInTable="CountColumn" msprop:Generator_UserColumnName="Count" type="xs:int" minOccurs="0" />
              <xs:element name="CPU" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCPU" msprop:Generator_ColumnPropNameInRow="CPU" msprop:Generator_ColumnPropNameInTable="CPUColumn" msprop:Generator_UserColumnName="CPU" type="xs:long" minOccurs="0" />
              <xs:element name="AvgCPU" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnAvgCPU" msprop:Generator_ColumnPropNameInRow="AvgCPU" msprop:Generator_ColumnPropNameInTable="AvgCPUColumn" msprop:Generator_UserColumnName="AvgCPU" type="xs:long" minOccurs="0" />
              <xs:element name="AvgReads" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnAvgReads" msprop:Generator_ColumnPropNameInRow="AvgReads" msprop:Generator_ColumnPropNameInTable="AvgReadsColumn" msprop:Generator_UserColumnName="AvgReads" type="xs:long" minOccurs="0" />
              <xs:element name="CPU1" msdata:ReadOnly="true" msdata:Caption="CPU" msprop:Generator_ColumnVarNameInTable="columnCPU1" msprop:Generator_ColumnPropNameInRow="CPU1" msprop:Generator_ColumnPropNameInTable="CPU1Column" msprop:Generator_UserColumnName="CPU1" type="xs:int" minOccurs="0" />
              <xs:element name="AvgCPU1" msdata:ReadOnly="true" msdata:Caption="AvgCPU" msprop:Generator_ColumnVarNameInTable="columnAvgCPU1" msprop:Generator_ColumnPropNameInRow="AvgCPU1" msprop:Generator_ColumnPropNameInTable="AvgCPU1Column" msprop:Generator_UserColumnName="AvgCPU1" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>